﻿using System;
using System.Collections.Generic;

namespace HobSoft.SoccerBet2014.Domain.DataService
{
    using Core;
    using Models;
    /// <summary>
    /// 管理博彩网站数据的存储
    /// </summary>
    public interface IBetGameDataService : IService
    {
        /// <summary>
        /// 停止指定host的Odds列表
        /// </summary>
        /// <param name="oddsIds">odds的id列表</param>
        /// <param name="host">Odds所属主机</param>
        void DisableOdds(byte bookerId, string host, IEnumerable<string> oddsIds);
        /// <summary>
        /// 删除指定存储ids的比赛
        /// </summary>
        /// <param name="gameIds">删除的比赛id列表</param>
        void DeleteGames(byte bookerId, IEnumerable<string> gameIds);
        /// <summary>
        /// 删除比赛开始时间在startBefore之前的比赛
        /// </summary>
        /// <param name="startBefore"></param>
        void DeleteExpiredGames(DateTime startBefore);
        /// <summary>
        /// 暂时停止指定赛事id的比赛
        /// </summary>
        /// <param name="gameIds"></param>
        void DisableGames(byte bookerId, IEnumerable<string> gameIds);
        Odds GetOdds(byte bookerId, string oddsId);
        Market GetMarket(byte bookerId, string gameId, string host);
        Game GetGame(byte bookerId, string gameId);
        IList<Game> GetGames(byte bookerId, IEnumerable<string> gameIds);
        IList<Market> GetMarket(byte bookerId, string host, IEnumerable<string> gameIds);
        /// <summary>
        /// 更新所有比赛，以及关联的market，Odds列表
        /// </summary>
        /// <param name="games"></param>
        /// <param name="markets"></param>
        /// <param name="oddsRange"></param>
        void UpdateRelatedGame(IList<Game> games, IList<Market> markets, IList<Odds> oddsRange);
        void UpdateAllGame(IList<Game> games);
        void UpdateAllOdds(IList<Odds> oddsRange);
        void UpdateAllMarket(IList<Market> marketRange);
        /// <summary>
        /// 比赛开始之前将Odds复制到一个列表副本中
        /// </summary>
        /// <param name="gameId"></param>
        void UpdatePreGameOdds(byte bookerId, string gameId);

    }
}
